import React,{Component} from 'react'

import {View,Text,Button} from 'react-native'

import Swiper from '../../components/Swiper'

import ajax from '../../utils/fetch'
import {GOODSDETAILS} from "../../const/shareUri";

export default class Home extends Component{
  static navigationOptions = {
    header:'详情'
  };
  constructor(props){
    super(props)
    //alert(this.props.navigation.state.params.item.price);
    this.state={
      propsItemData:this.props.navigation.state.params.item,
      bannerList:[]
    }
  }
  componentDidMount(){
    this.initData();
  }

  initData=()=>{
    ajax.get(GOODSDETAILS,{
      md5: this.state.propsItemData.md5,
      promotionTypeId: 6
    },res=>{
      //alert(res.data.details.mainPics.length);
      this.setState({bannerList:res.data.details.mainPics})
    })
  }

  render(){
    return (
       <View>
         <Swiper biLie={1} bannerData={this.state.bannerList}/>
       </View>
    );
  }
}